package iot.core.data.mapper;

import iot.core.data.entity.HTDept;
import iot.core.data.entity.HTUserDept;
import iot.core.manager.auth.HTDeptBaseDto;
import jakarta.validation.Valid;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface HTUserDeptMapper extends MyBaseMapper<HTUserDept> {

    //获取关联机构
    @Select(value = {"select b.id,b.Name,b.PId ,b.HTPlat_Id\n" +
            "from htuserdept a\n" +
            "inner join htdept b on a.HTUser_Id=#{id} and a.HTDept_Id =b.Id and a.State ='启用' and a.Deleted=0"})
    List<HTDeptBaseDto> getUserDept(Long id);
}

